package ca.tatham.scheduler;

import java.util.Collection;

/**
 * A Task is a prioritized Thread. Highest Priority is 0 (zero).
 * 
 * @author BenTatham
 */
public interface Task extends Prioritizable {

	// /**
	// * The Task must wait() itself as soon as possible after this method is
	// * called.
	// *
	// * @see Object#wait()
	// */
	// void block();
	//
	// /**
	// * If this task is blocked, it may resume running again.
	// *
	// * @see Object#notify();
	// */
	// void release();

	void doTask();

	Collection<Object> getUsedResources();

	long getId();

	String getName();

	int getPriority();

	int getOriginalPriority();

	/**
	 * 
	 * @return true if the Task is still running at a promoted priority, false
	 *         if back to original
	 */
	boolean demote();

	void promote(int priority);

	// boolean isStarted();

	boolean isComplete();

	// void block() throws InterruptedException;
	//
	// void release();

}
